﻿@model IEnumerable<Barry.BarbeSystem.Models.ConsumeHistory>
@{
    ViewBag.Title = "Index";
}
@section header{
    <script type="text/javascript">
        $(document).ready(function() {
            var pager = $('#dg').datagrid('getPager'); // get the pager of datagrid
            pager.pagination({ showPageList: false });

        });

        function doSearch() {
            $("#dg").datagrid('load', {
                cardId: $("#card_id").val(),
                name: $("#name").val()
            });
        }

        function formatColumn(colName, value, row, index) {
            return eval("row." + colName);
        }
        function formatColumn1(colName, value, row, index) {
            return eval("row." + colName);
        }
        function formatterdate(val, row) {
            var date = new Date(parseInt(val.substr(6)));

            return date.toLocaleDateString();

        }

    </script>
}
<div id="tb" style="padding: 5px; height: auto">
    <div>
        卡号:
        <input class="" style="width: 80px" id="card_id">
        姓名：<input type="text" id="name" style="width: 80px;" />
        <a href="#" class="easyui-linkbutton" iconcls="icon-search" onclick=" doSearch() ">Search</a>
    </div>
</div>
<table id="dg" data-options="rownumbers:true,singleSelect:true,pagination:true" title="会员充消费记录"
    class="easyui-datagrid" url="/member/PageConsumeHistory" toolbar="#tb">
    <thead>
        <tr>
            <th field="not used" formatter="(function(v,r,i){return formatColumn('Member.CardId',v,r,i);})"  data-options="width:100">
                @Html.DisplayNameFor(model => model.Member.CardId)
            </th>
            <th field="not used1" formatter="(function(v,r,i){return formatColumn('Member.Name',v,r,i);})" data-options="width:100">
                @Html.DisplayNameFor(model => model.Member.Name)
            </th>
       
            <th field="Balance" data-options="width:100">
                @Html.DisplayNameFor(model => model.Balance)
            </th>
            <th field="ConsumeAmount" data-options="width:100">
                @Html.DisplayNameFor(model => model.ConsumeAmount)
            </th>
            
              <th field="CurrentDate" formatter="formatterdate" data-options="width:100">
                @Html.DisplayNameFor(model => model.CurrentDate)
            </th>

            <th field="Remarks" data-options="width:200">
                @Html.DisplayNameFor(model => model.Remarks)
            </th>
        </tr>
    </thead>
    <tbody>
        @*  @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PhoneNumber)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Balance)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Discount)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Remarks)
                </td>
                <td>
                    @Html.ActionLink("编辑", "Edit", new { id = item.Id }) |
                
                    @Html.ActionLink("删除", "Delete", new { id = item.Id })
                </td>
            </tr>
        }*@
    </tbody>
</table>
